﻿<div class="blade-static __expanded">
    <va-breadcrumb ng-model="blade.breadcrumbs" blade-id="blade.id"></va-breadcrumb>
    <div class="form-group">
        <div class="form-input __search">
            <input placeholder="Search keyword..." ng-model="filter.searchKeyword" ng-keyup="$event.which === 13 && blade.refresh()">
        </div>
        <p class="form-count">Count: <span class="count">{{pageSettings.totalItems}}</span></p>
    </div>
</div>
<div class="blade-static __bottom" ng-if="pageSettings.itemsPerPageCount < pageSettings.totalItems" ng-include="'pagerTemplate.html'"></div>
<div class="blade-content __medium-wide">
    <div class="blade-inner">
        <div class="inner-block">
            <div class="table-wrapper" ng-if="items.length > 0">
                <table class="table">
                    <thead>
                        <tr>
                            <th class="table-col __product-control">
                                <label class="form-control __checkbox">
                                    <input type="checkbox" ng-model="selectedAll" ng-change="checkAll(selectedAll)" />
                                    <span class="check"></span>
                                </label>
                            </th>
                            <th class="table-col __product-img">Pic</th>
                            <th class="table-col __product-name">Name</th>
                            <th class="table-col __product-code">SKU</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="table-item" ng-repeat="data in items track by data.id" ng-class="{'__selected': data.id === selectedItem.id}" context-menu data-target="cil_menu_{{data.id+blade.level}}">
                            <td class="table-col">
                                <label class="form-control __checkbox" ng-if="showCheck(data)">
                                    <input type="checkbox" ng-model="data.selected" ng-change="checkOne(data)">
                                    <span class="check"></span>
                                </label>
                            </td>
                            <td class="table-col" ng-click='selectItem($event, data)'>
                                <div class="product-img">
                                    <div class="image" ng-style="{'background-image': 'url(' + data.imageUrl + ')' }" ng-if="data.type!=='category' && data.imageUrl"></div>
                                    <i class="table-ico fa" ng-class="data.type == 'category' ? ' fa-folder' : ' fa-image'" ng-if="!data.imageUrl"></i>
                                </div>
                            </td>
                            <td class="table-col __product-name" ng-click='selectItem($event, data)'>
                                <i class="table-ico fa fa-link" ng-if="hasLinks(data)" title="This category is linked"></i>
                                <div class="table-t">{{data.name}}</div>
                                <span class="table-status" ng-if="data.type==='category' && !data.isActive">Inactive</span>
                                <div class="table-descr">{{data.productType}}</div>

                                <ul class="menu __context" role="menu" id="cil_menu_{{data.id+blade.level}}">
                                    <li class="menu-item" ng-click='edit(data)'>
                                        <i class="menu-ico fa fa-edit"></i> Manage
                                    </li>
                                    <li class="menu-item" ng-click='delete()'>
                                        <i class="menu-ico fa fa-trash-o"></i> Delete
                                    </li>
                                </ul>
                            </td>
                            <td class="table-col __product-code" ng-click='selectItem($event, data)'>
                                {{data.type!=='category'?data.code:''}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="note" ng-if="items.length == 0">
                No data
            </div>
        </div>
    </div>
</div>